package com.sa.web.util.tags;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.components.Component;
import org.apache.struts2.views.jsp.ComponentTagSupport;

import com.opensymphony.xwork2.util.ValueStack;

public class PageTags extends ComponentTagSupport {
	
	private String action;
	
	private int pageCount;

	@Override
	public Component getBean(ValueStack arg0, HttpServletRequest arg1,
			HttpServletResponse arg2) {
		return new PageService(arg0);
	}
	
	@Override
	protected void populateParams() {
		super.populateParams();
		PageService ps = (PageService) getComponent();
		ps.setAction(getAction());
		ps.setPageCount(getPageCount());
	}

	public String getAction() {
		return action;
	}

	public void setAction(String action) {
		this.action = action;
	}

	public int getPageCount() {
		return pageCount;
	}

	public void setPageCount(int pageCount) {
		this.pageCount = pageCount;
	}

}
